package com.geo.ai.adapter;

/**
 * 模型使用统计信息
 */
public class ModelUsageStats {
    private long totalRequests;
    private long successfulRequests;
    private long failedRequests;
    private long totalTokensUsed;
    private double totalCost;
    private long averageResponseTime;
    
    // 构造函数、getter和setter
    public ModelUsageStats() {}
    
    public ModelUsageStats(long totalRequests, long successfulRequests, long failedRequests, 
                          long totalTokensUsed, double totalCost, long averageResponseTime) {
        this.totalRequests = totalRequests;
        this.successfulRequests = successfulRequests;
        this.failedRequests = failedRequests;
        this.totalTokensUsed = totalTokensUsed;
        this.totalCost = totalCost;
        this.averageResponseTime = averageResponseTime;
    }
    
    // Getters and Setters
    public long getTotalRequests() { return totalRequests; }
    public void setTotalRequests(long totalRequests) { this.totalRequests = totalRequests; }
    
    public long getSuccessfulRequests() { return successfulRequests; }
    public void setSuccessfulRequests(long successfulRequests) { this.successfulRequests = successfulRequests; }
    
    public long getFailedRequests() { return failedRequests; }
    public void setFailedRequests(long failedRequests) { this.failedRequests = failedRequests; }
    
    public long getTotalTokensUsed() { return totalTokensUsed; }
    public void setTotalTokensUsed(long totalTokensUsed) { this.totalTokensUsed = totalTokensUsed; }
    
    public double getTotalCost() { return totalCost; }
    public void setTotalCost(double totalCost) { this.totalCost = totalCost; }
    
    public long getAverageResponseTime() { return averageResponseTime; }
    public void setAverageResponseTime(long averageResponseTime) { this.averageResponseTime = averageResponseTime; }
    
    /**
     * 获取成功率
     * @return 成功率百分比
     */
    public double getSuccessRate() {
        if (totalRequests == 0) return 0.0;
        return (double) successfulRequests / totalRequests * 100;
    }
}